
#ifndef EFFECT_H
#define EFFECT_H

#include "D3D11.h"
#include "DeviceManager.h"

enum ShaderTarget
{
	Target_VertexShader,
	Target_PixelShader,
	Target_GeometryShader,
	Target_HullShader,
	Target_DomainShader,
};

struct InputLayoutDesc
{
	D3D11_INPUT_ELEMENT_DESC * mpDesc;
	int mDescSize;
};

class Effect
{
public:
	
	static Effect* Create(DeviceManager* pDeviceManager, InputLayoutDesc* pLayoutDesc, char* pFilename, char* pVertexShaderEntry, char* pPixelShaderEntry, char* pGeometryShaderEntry, char* pDomainShaderEntry, char* pHullShaderEntry, bool model5);
	void Release();
	
	ID3D11InputLayout* GetInputLayout() const;

	LPVOID GetByteCodeBufferPointer() const;
	int GetByteCodeBufferSize() const;

	void Apply();

private:
	Effect();
	DeviceManager* mpDeviceManager;
	bool Compile(char* pFilename, char* pEntryPoint, ShaderTarget target, bool model5);

	LPVOID mpVertexByteCode;
	int mVertexByteSize;

	ID3D11InputLayout* mpInputLayout;

	ID3D11VertexShader* mpVertexShader;
	ID3D11PixelShader* mpPixelShader;
	ID3D11GeometryShader* mpGeometryShader;
	ID3D11HullShader* mpHullShader;
	ID3D11DomainShader* mpDomainShader;
	
};

#endif